package fr.lelouet.tools.regression.simple;

/** contains informtions about the values stored in a dimension */
public class DimensionInformations {

	double minVal = Double.MAX_VALUE, maxVal = Double.MIN_VALUE;

	/** to call when a value has been added to the dimension */
	public void containsValue(double d) {
		if (d < minVal) {
			minVal = d;
		}
		if (d > maxVal) {
			maxVal = d;
		}
	}

	/** @return true if there are at least two values in the dimension */
	public boolean hasEnoughRange() {
		return minVal != Double.MAX_VALUE && maxVal != Double.MIN_VALUE
				&& maxVal != minVal;
	}

	public double minVal() {
		return minVal;
	}

	public double maxVal() {
		return maxVal;
	}

}
